<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

use Hyperf\HttpServer\Router\Router;

Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');
Router::addRoute(['GET', 'POST', 'HEAD'], '/health', 'App\Controller\HealthController@health');
Router::addGroup('/api', function () {
    //小程序抽奖
    Router::get('/pizza_list', 'App\Controller\Api\PrizeController@list');//奖品列表
    Router::post('/pizza_lottery', 'App\Controller\Api\PrizeController@lottery');//用户抽奖
    Router::get('/pizza_lotteryLog', 'App\Controller\Api\PrizeController@lotteryLog');//抽奖记录
});


Router::addGroup('/admin', function () {
    //渠道配置
    Router::get('/area_list', 'App\Controller\Admin\AreaController@list');//地区列表
    Router::get('/channel_list', 'App\Controller\Admin\ChannelController@list');//获取渠道列表
    Router::get('/channel_all', 'App\Controller\Admin\ChannelController@all');//获取全部渠道
    Router::post('/channel_add', 'App\Controller\Admin\ChannelController@add');//添加渠道
    Router::addRoute(['GET', 'POST'],'/channel_edit', 'App\Controller\Admin\ChannelController@edit');//编辑渠道
    Router::post('/channel_del', 'App\Controller\Admin\ChannelController@del');//删除渠道
    Router::post('/channel_remark', 'App\Controller\Admin\ChannelController@remark');//编辑渠道备注信息
    Router::get('/channel_areaList', 'App\Controller\Admin\ChannelController@areaList');//获取渠道地区列表配置
    Router::post('/channel_areaEdit', 'App\Controller\Admin\ChannelController@areaEdit');//新增/删除渠道地区配置
    Router::post('/channel_areaBatchEdit', 'App\Controller\Admin\ChannelController@areaBatchEdit');//批量编辑渠道地区配置（市级全选/全不选）
    Router::post('/channel_areaBatchAllEdit', 'App\Controller\Admin\ChannelController@areaBatchAllEdit');//批量编辑渠道地区配置（省级级全选/全不选）
    Router::addRoute(['GET', 'POST'],'/channel_rechargeAmount', 'App\Controller\Admin\ChannelController@rechargeAmount');//编辑渠道充值金额

    //油卡合作商配置
    Router::get('/oilChannel_list', 'App\Controller\Admin\OilChannelController@list');//获取合作商列表
    Router::get('/oilChannel_all', 'App\Controller\Admin\OilChannelController@all');//获取全部合作商
    Router::post('/oilChannel_add', 'App\Controller\Admin\OilChannelController@add');//添加合作商
    Router::addRoute(['GET', 'POST'],'/oilChannel_edit', 'App\Controller\Admin\OilChannelController@edit');//编辑合作商
    Router::post('/oilChannel_del', 'App\Controller\Admin\OilChannelController@del');//删除合作商
    Router::post('/oilChannel_remark', 'App\Controller\Admin\OilChannelController@remark');//编辑合作商备注信息
    Router::addRoute(['GET', 'POST'],'/oilChannel_rechargeAmount', 'App\Controller\Admin\OilChannelController@rechargeAmount');//编辑合作商充值金额

    //管理员日志
    Router::get('/log_list', 'App\Controller\Admin\LogController@list');//管理员日志列表
    Router::addRoute(['GET', 'POST'],'/manage_list', 'App\Controller\Admin\ManageController@list');
    Router::addRoute(['GET', 'POST'],'/manage_add', 'App\Controller\Admin\ManageController@add');
    Router::addRoute(['GET', 'POST'],'/manage_edit', 'App\Controller\Admin\ManageController@edit');
    Router::addRoute(['GET', 'POST'],'/manage_del', 'App\Controller\Admin\ManageController@del');
    Router::addRoute(['GET', 'POST'],'/manage_password', 'App\Controller\Admin\ManageController@password');
    Router::addRoute(['GET', 'POST'],'/rbac_menu', 'App\Controller\Admin\RbacController@menu');
    Router::addRoute(['GET', 'POST'],'/permission_list', 'App\Controller\Admin\RbacController@permissionList');
    Router::addRoute(['GET', 'POST'],'/rbac_permission_add', 'App\Controller\Admin\RbacController@permissionAdd');
    Router::addRoute(['GET', 'POST'],'/rbac_permission_edit', 'App\Controller\Admin\RbacController@permissionEdit');
    Router::addRoute(['GET', 'POST'],'/rbac_permission_del', 'App\Controller\Admin\RbacController@permissionDel');
    Router::addRoute(['GET', 'POST'],'/rbac_role_list', 'App\Controller\Admin\RbacController@roleList');
    Router::addRoute(['GET', 'POST'],'/rbac_role_all', 'App\Controller\Admin\RbacController@roleAll');
    Router::addRoute(['GET', 'POST'],'/rbac_role_add', 'App\Controller\Admin\RbacController@roleAdd');
    Router::addRoute(['GET', 'POST'],'/rbac_role_edit', 'App\Controller\Admin\RbacController@roleEdit');
    Router::addRoute(['GET', 'POST'],'/rbac_role_permision_edit', 'App\Controller\Admin\RbacController@rolePermisionEdit');
    Router::addRoute(['GET', 'POST'],'/rbac_role_del', 'App\Controller\Admin\RbacController@roleDel');
    Router::addRoute(['GET'],'/login_verify', 'App\Controller\Admin\LoginController@verify');
    Router::addRoute(['GET', 'POST'],'/login', 'App\Controller\Admin\LoginController@login');
    Router::addRoute(['GET', 'POST'],'/login_reflush', 'App\Controller\Admin\LoginController@refreshToken');
    
    
    
});  

Router::addGroup('/admin/amount_', function () {
    Router::post('typeList', 'App\Controller\Admin\AmountController@typeList');//话费充值类型列表     
    Router::post('typeAdd', 'App\Controller\Admin\AmountController@typeAdd');//话费充值类型新增     
    Router::post('typeEdit', 'App\Controller\Admin\AmountController@typeEdit');//话费充值类型编辑       
    Router::post('typeDel', 'App\Controller\Admin\AmountController@typeDel');//话费充值类型删除      
    Router::post('list', 'App\Controller\Admin\AmountController@list');  //话费充值金额列表     
    Router::get('amountAddInfo', 'App\Controller\Admin\AmountController@amountAddInfo');//话费金额新增配置信息     
    Router::post('amountAdd', 'App\Controller\Admin\AmountController@amountAdd');//新增话费金额     
    Router::post('amountEdit', 'App\Controller\Admin\AmountController@amountEdit');//编辑话费金额  
    // Router::post('amountForbid', 'App\Controller\Admin\AmountController@amountForbid');//话费金额禁止     
    Router::post('amountDel', 'App\Controller\Admin\AmountController@amountDel'); //话费金额删除       
    // Router::post('amountOpen', 'App\Controller\Admin\AmountController@amountOpen');//话费金额启用     
    Router::post('channelEdit', 'App\Controller\Admin\AmountController@channelEdit');//话费金额渠道关联  
    Router::post('oilList', 'App\Controller\Admin\AmountController@oilList');//油卡充值金额列表     
    Router::post('oilAdd', 'App\Controller\Admin\AmountController@oilAdd');//油卡充值金额新增     
    Router::post('oilEdit', 'App\Controller\Admin\AmountController@oilEdit');//油卡充值金额编辑     
    Router::post('oilDel', 'App\Controller\Admin\AmountController@oilDel');//油卡充值金额删除  
    Router::post('oilChannel', 'App\Controller\Admin\AmountController@oilChannel');//油卡充值金额渠道关联  
    Router::get('rpcTest', 'App\Controller\Admin\AmountController@rpcTest');//油卡充值金额渠道关联  
});


Router::addGroup('/admin/coupon_', function () {
    Router::post('list', 'App\Controller\Admin\CouponController@list');//红包明细日志列表     
    Router::post('batchList', 'App\Controller\Admin\CouponController@batchList');//红包批次列表     
    Router::get('getBatch', 'App\Controller\Admin\CouponController@getBatch');//红包券返回批次码     
    Router::post('generateCoupon', 'App\Controller\Admin\CouponController@generateCoupon');//生成红包券     
    Router::post('couponBatch', 'App\Controller\Admin\CouponController@couponBatch');//批次内容查询  
    Router::post('batchEdit', 'App\Controller\Admin\CouponController@batchEdit');//优惠券批次编辑
    // Router::post('batchForbid', 'App\Controller\Admin\CouponController@batchForbid');//优惠券批次禁用
    Router::post('batchDel', 'App\Controller\Admin\CouponController@batchDel');//优惠券批次删除    
    // Router::post('batchOpen', 'App\Controller\Admin\CouponController@batchOpen');//优惠券批次启用  
    Router::post('statistics', 'App\Controller\Admin\CouponController@statistics');//优惠券统计
    Router::post('compare', 'App\Controller\Admin\CouponController@compare');//优惠券使用情况对比
    Router::get('outputLog', 'App\Controller\Admin\CouponController@outputLog');//优惠券日志导出
    
});

Router::addGroup('/admin/lottery_', function () {
    Router::addRoute(['GET', 'POST'], 'list','App\Controller\Admin\LotteryController@list');//抽奖日志列表     
    Router::post('prize', 'App\Controller\Admin\LotteryController@prize');//奖品列表     
    Router::post('prizeAdd', 'App\Controller\Admin\LotteryController@prizeAdd');//新增奖品     
    Router::post('prizeEdit', 'App\Controller\Admin\LotteryController@prizeEdit');//编辑奖品     
    // Router::post('prizeForbid', 'App\Controller\Admin\LotteryController@prizeForbid');//奖品禁用  
    Router::post('prizeDel', 'App\Controller\Admin\LotteryController@prizeDel');//奖品删除
    Router::get('outputLog', 'App\Controller\Admin\LotteryController@outputLog');//奖品记录导出

});

Router::addGroup('/api/coupon_', function () {
    Router::addRoute(['GET', 'POST'],'receive', 'App\Controller\Api\CouponController@receive');//领取优惠券     
});

Router::addGroup('/api/index_', function () {
    Router::get('rechargeType', 'App\Controller\Api\IndexController@rechargeType');//返回充值类型数据     
    Router::post('amount', 'App\Controller\Api\IndexController@amount');//返回充值金额列表
    Router::post('oilAmount', 'App\Controller\Api\IndexController@oilAmount');//返回油卡充值金额列表          
    Router::post('isHasCoupon', 'App\Controller\Api\IndexController@isHasCoupon');//返回判断用户是否有可用红包     
    Router::post('userCoupon', 'App\Controller\Api\IndexController@userCoupon');//获取用户可用红包信息     
    Router::post('userCouponAll', 'App\Controller\Api\IndexController@userCouponAll');//返回充值类型数据
    Router::post('mobile_operator', 'App\Controller\Api\IndexController@mobileOperator');//返回充值类型数据

});

Router::addGroup('/api/wxnotice',function (){
    Router::get('/get_notice','App\Controller\Api\WxnoticeController@getNotice'); //小程序活动页获取
    Router::get('/list_notice','App\Controller\Api\WxnoticeController@listNotice'); //小程序活动页列表页获取
    Router::get('/article_list', 'App\Controller\Api\WxnoticeController@articleList');//小程序资讯列表
    Router::get('/article_last', 'App\Controller\Api\WxnoticeController@articleLast');//小程序获取单条资讯
});

Router::addGroup('/api/wxservice',function (){
    Router::addRoute(['GET','POST'],'/form_msg','App\Controller\Api\WxserviceController@formMsg');//问题反馈
    Router::get('/get_list','App\Controller\Api\WxserviceController@getList'); //问题反馈类型列表
});

Router::addGroup('/api/wxuser',function (){
    Router::get('/loginnew','App\Controller\Api\WxuserController@loginNew'); //小程序登录
    Router::post('/logininfo','App\Controller\Api\WxuserController@loginInfo'); //小程序授权信息
    Router::get('/sign','App\Controller\Api\WxuserController@sign');            //签到
    Router::get('/sign_check', 'App\Controller\Api\WxuserController@signCheck'); // 签到状态查询
    Router::get('/record', 'App\Controller\Api\WxuserController@record');       //访问记录
    Router::get('/share','App\Controller\Api\WxuserController@share');           //分享数据查询
    Router::get('/addsmall', 'App\Controller\Api\WxuserController@addsmall');   //添加小程序
    Router::get('/get_ali_user', 'App\Controller\Api\WxuserController@getUserInfo');   //获取用户信息
    Router::get('/save_ali_user', 'App\Controller\Api\WxuserController@saveAliUser');   //支付宝小程序保存用户信息
    Router::get('/get_ali_token', 'App\Controller\Api\WxuserController@getAliToken');   //支付宝小程序获取token
});

Router::addGroup('/api/index',function (){
    Router::post('/upload_img', 'App\Controller\Api\IndexController@uploadImg');//本地图片上传
    Router::post('/download_img', 'App\Controller\Api\IndexController@downloadImg');//网络图片上传
});

Router::addRoute(['GET'], '/admin/requestlog/log_list', 'App\Controller\Admin\RequestlogController@logList'); //日志列表

Router::addGroup('/admin/wxnotice',function (){
    Router::get('/index', 'App\Controller\Admin\WxnoticeController@index');//小程序活动页列表查看和编辑
    Router::addRoute(['GET', 'POST'],'/edit','App\Controller\Admin\WxnoticeController@edit'); //基本的活动信息列表单条查看和编辑
});

Router::addGroup('/admin/wxservice',function (){
    Router::get('/index', 'App\Controller\Admin\WxserviceController@index');//问题反馈列表
    Router::addRoute(['GET', 'POST'],'/edit','App\Controller\Admin\WxserviceController@edit'); //问题反馈列表编辑处理

    Router::get('/typeAll', 'App\Controller\Admin\WxserviceController@typeAll');//问题反馈类型列表
    Router::addRoute(['GET', 'POST'],'/typeEdit','App\Controller\Admin\WxserviceController@typeEdit');//问题反馈类型编辑
    Router::post('/typeAdd', 'App\Controller\Admin\WxserviceController@typeAdd');//问题反馈类型新增
    Router::post('/typeDel', 'App\Controller\Admin\WxserviceController@typeDel');//问题反馈类型删除

    Router::get('/classifyAll', 'App\Controller\Admin\WxserviceController@classifyAll');//获取全部问题分类
    Router::addRoute(['GET', 'POST'],'/classifyEdit','App\Controller\Admin\WxserviceController@classifyEdit');//编辑问题分类
    Router::post('/classifyAdd', 'App\Controller\Admin\WxserviceController@classifyAdd');//新增问题分类
    Router::post('/classifyDel', 'App\Controller\Admin\WxserviceController@classifyDel');//删除问题分类

    Router::get('/countRank', 'App\Controller\Admin\WxserviceController@countRank');//反馈数据排行列表数据
    Router::get('/countTypeRank', 'App\Controller\Admin\WxserviceController@countTypeRank');//反馈数据类型排行列表数据
});

Router::addGroup('/admin/wxuser',function (){
    Router::get('/user_list', 'App\Controller\Admin\WxuserController@userList');//获取小程序用户信息列表
    Router::addRoute(['GET', 'POST'],'/user_edit', 'App\Controller\Admin\WxuserController@userEdit');//获取小程序用户信息编辑
    Router::get('/map_users','App\Controller\Admin\WxuserController@mapUsers'); //用户地图数据
});

Router::addGroup('/admin/wxvisit',function (){
    Router::get('/visitbase', 'App\Controller\Admin\WxvisitController@visitBase');//获取微信服务器数据
    Router::get('/visithistory', 'App\Controller\Admin\WxvisitController@visitHistory');//累计访问人数
    Router::get('/webs', 'App\Controller\Admin\WxvisitController@websData');//生成按天统计子页面的访问数据
    Router::get('/wxdata_show', 'App\Controller\Admin\WxvisitController@wxDataShow');//显示微信后台数据
    Router::get('/core_data', 'App\Controller\Admin\WxvisitController@coreData');//显示微信后台数据
});

Router::addGroup('/admin/article_',function (){
    Router::get('list', 'App\Controller\Admin\ArticleController@list');//资讯列表
    Router::post('add', 'App\Controller\Admin\ArticleController@add');//添加资讯
    Router::addRoute(['GET', 'POST'],'edit', 'App\Controller\Admin\ArticleController@edit');//编辑资讯
    Router::get('change', 'App\Controller\Admin\ArticleController@change');//资讯状态修改
    Router::get('delete', 'App\Controller\Admin\ArticleController@delete');//资讯删除
});